<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
            

    Promise.all([ajax(1000),ajax(2000),ajax(5000),ajax(3000)]).then(()=>{
        console.log("所有任务都完成");
    })
    Promise.race([ajax(1000),ajax(2000),ajax(5000),ajax(3000)]).then(()=>{
        console.log("已完成一个任务，还有些任务没有完成");
    })
</script>